package com.maidada.mddaichat.common;

import lombok.Data;

/**
 * 通用响应类
 *
 * @author wulinxuan
 * @date 2024/12/17 22:43
 */
@Data
public class BaseResponse<T> {

    private int code;

    private T data;

    private String msg;

    public BaseResponse(int code, T data, String msg) {
        this.code = code;
        this.data = data;
        this.msg = msg;
    }

    public BaseResponse(ErrorCode errorCode) {
        this(errorCode.getCode(), null, errorCode.getMsg());
    }
}
